/**
 * 用户实体
 */
export interface User {
  id: string;
  username: string;
  email: string;
  nickname?: string;
  avatar?: string;
  bio?: string;
  createdAt: Date | string;
  updatedAt: Date | string;
  lastLoginAt?: Date | string;
  roles: string[];
  status: string;
  phoneNumber?: string;
  verified: boolean;
}

/**
 * 用户设置
 */
export interface UserSettings {
  theme: string;
  language: string;
  notifications: NotificationSettings;
  privacy: PrivacySettings;
  editorDefaults: EditorDefaults;
  autoSave: boolean;
  autoSaveInterval: number;
}

/**
 * 通知设置
 */
export interface NotificationSettings {
  email: boolean;
  push: boolean;
  comments: boolean;
  likes: boolean;
  follows: boolean;
  updates: boolean;
}

/**
 * 隐私设置
 */
export interface PrivacySettings {
  profileVisibility: string;
  projectVisibility: string;
  showActivity: boolean;
  allowTagging: boolean;
}

/**
 * 编辑器默认设置
 */
export interface EditorDefaults {
  defaultFrameRate: number;
  defaultResolution: {
    width: number;
    height: number;
    aspectRatio: string;
  };
  gridEnabled: boolean;
  gridSize: number;
  snapToGrid: boolean;
  rulerEnabled: boolean;
  autoKeyframe: boolean;
  defaultEasing: string;
  timelineZoom: number;
  showFPS: boolean;
  autoPause: boolean;
}

/**
 * 创作者资料
 */
export interface CreatorProfile {
  userId: string;
  verificationStatus: string;
  verifiedAt?: Date | string;
  portfolio?: string;
  specialties?: string[];
  earnings: number;
  rating?: number;
  followers: number;
  bio?: string;
  socialLinks?: SocialLink[];
}

/**
 * 社交链接
 */
export interface SocialLink {
  platform: string;
  url: string;
  displayName?: string;
}

/**
 * 登录请求参数
 */
export interface LoginRequest {
  username: string;
  password: string;
}

/**
 * 登录响应
 */
export interface LoginResponse {
  success: boolean;
  token?: string;
  user?: User;
  message?: string;
}

/**
 * 注册请求参数
 */
export interface RegisterRequest {
  username: string;
  email: string;
  password: string;
  confirmPassword?: string;
}

/**
 * 注册响应
 */
export interface RegisterResponse {
  success: boolean;
  message?: string;
}

/**
 * 用户资料响应
 */
export interface UserProfileResponse {
  success: boolean;
  user?: User;
  message?: string;
}

/**
 * 用户设置响应
 */
export interface UserSettingsResponse {
  success: boolean;
  settings?: UserSettings;
  message?: string;
}

/**
 * 更新用户设置请求
 */
export interface UpdateUserSettingsRequest {
  settings: Partial<UserSettings>;
}

/**
 * 更新用户设置响应
 */
export interface UpdateUserSettingsResponse {
  success: boolean;
  message?: string;
}

/**
 * 用户个人主页信息
 */
export interface UserProfileInfo {
  id: string;
  username: string;
  nickname?: string;
  avatar?: string;
  bio?: string;
  level?: number;
  isCreator: boolean;
  isFollowed: boolean;
  workCount: number;
  followingCount: number;
  followerCount: number;
  likeCount: number;
  createdAt: Date | string;
  lastActiveAt?: Date | string;
  socialLinks?: SocialLink[];
}

/**
 * 用户作品
 */
export interface UserWork {
  id: string;
  title: string;
  thumbnail: string;
  duration: number; // 毫秒
  views: number;
  likes: number;
  createdAt: Date | string;
  isOriginal?: boolean;
  tags?: string[];
  description?: string;
}

/**
 * 用户收藏
 */
export interface UserCollection {
  id: string;
  title: string;
  thumbnail: string;
  duration: number;
  author: string;
  authorId?: string;
  views: number;
  likes: number;
  collectedAt?: Date | string;
}

/**
 * 用户作品列表响应
 */
export interface UserWorksResponse {
  success: boolean;
  works?: UserWork[];
  total: number;
  page: number;
  pageSize: number;
  message?: string;
}

/**
 * 用户收藏列表响应
 */
export interface UserCollectionsResponse {
  success: boolean;
  collections?: UserCollection[];
  total: number;
  page: number;
  pageSize: number;
  message?: string;
}

/**
 * 关注用户请求
 */
export interface FollowUserRequest {
  userId: string;
}

/**
 * 关注用户响应
 */
export interface FollowUserResponse {
  success: boolean;
  isFollowed: boolean;
  message?: string;
} 